﻿@model Telecom.Data.THUEBAO_GPON


@{  AjaxOptions ajaxOpts = new AjaxOptions
    {
        HttpMethod = "post",
        OnComplete = "completedAjaxRequestAddTHUEBAOONT"
    };
}

<script type="text/javascript">

    function opBeginProcess_loading_window_submit() {

        $("#ContentwindowFunction").mask("Dữ liệu đang xử lý");
    }

    function completedAjaxRequestAddTHUEBAOONT(obj) {

        var returnObj = eval('(' + obj.responseText + ')');

        if (returnObj.Status == "success") {

            var $rowReload = $('#listTbaleOnTGPON').jtable('getRowByKey', $("#ONT_ID_ADDONTTB").val());
            $rowReload.next().find('.jtable-child-table-container').jtable('reload')

            close_window_elements('window_addupdate_ontGPON');


        } else {

            $("#ContentwindowFunction").unmask();
            confirmOptionNormal(returnObj.Message);
        }

        return false;

    }

    $(document).ready(function () {


        $("#SITEIDAdUpLTB").combobox({
            url: _nameSubDomain + "/Vnpt_Site/listVNPTSITEONDONTOQL_MAVT?mavt=PON&toql=@ViewBag.ToqlADDTBONT&donvi=@ViewBag.DOnVIADDTBONT",
            valueField: "SITEID",
            textField: "TEN",
            onSelect: function (row) {

                $("#SITEID_AdUpLTB").val(row.SITEID);

            }

        });

        $("#THUEBAO_ID_ADD_THUEBAOONT").combobox({
            url: _nameSubDomain + "/ONTGpon/getListThueBaoCSSGPON?mavt=PON&toql=@ViewBag.ToqlADDTBONT&donviql=@ViewBag.DOnVIADDTBONT",
             valueField: "THUEBAO_ID",
             textField: "TEN_TB",
             onSelect: function (row) {

                 $("#THUEBAO_ID_ADDONTTB").val(row.THUEBAO_ID);

             }

         });


    });

    function loadwindow_add_site_thuebao_ont() {

        loadwindowOnContent(_nameSubDomain + "/Vnpt_Site/AddVNPTSITE_LAPTB?ma=&ten=&loaiSite=PON&donvi=@ViewBag.DOnVIADDTBONT&toql=@ViewBag.ToqlADDTBONT", "window_add_vnpt_site_laptb", "Thêm VNPT SITE", 620, 600);

    }

   

</script>

@using (Ajax.BeginForm("AddTHUEBAOONT", "ONTGpon", null, ajaxOpts, new { enctype = "multipart/form-data" }))
{
    @Html.HiddenFor(model => model.ID)
    @Html.HiddenFor(model => model.THUEBAO_ID, new { id = "THUEBAO_ID_ADDONTTB" })
    @Html.HiddenFor(model => model.ONT_ID, new { id = "ONT_ID_ADDONTTB" })
    @Html.HiddenFor(model => model.SITE_ID, new { id = "SITEID_AdUpLTB" })
    
    <div id="ContentwindowFunction" class="ContentwindowFunction">
        <table class="tableContentWindowFunction">
            <tr>
                <td>
                    ONT: 
                </td>
                <td>
                    <span>@ViewBag.ONTSITE</span> &nbsp;-&nbsp; @ViewBag.THUTUONT
                </td>
            </tr>
            <tr>
                <td>Thuê Bao Id
                </td>
                <td>
                    <input class="easyui-combobox" value="@Model.THUEBAO_ID" style="width:450px;height:27px" id="THUEBAO_ID_ADD_THUEBAOONT" name="THUEBAO_ID_ADD_THUEBAOONT">
                </td>
            </tr>
            <tr>
                <td>SITE Lắp đặt
                </td>
                <td style="position:relative;">
                    <input class="easyui-combobox" value="@Model.SITE_ID" style="width:415px;height:27px" id="SITEIDAdUpLTB" name="SITEIDAdUpLTB">
                    <div style="position: absolute;top: 5px;right: 15px;">
                         <button type="button" onclick="return loadwindow_add_site_thuebao_ont();" style="padding:3px 0" >
                            <span class="l-btn-left l-btn-icon-left"><span class="l-btn-text"></span><span class="l-btn-icon icon-add">&nbsp;</span></span>
                         </button>
                    </div>
                </td>
            </tr>
            <tr>
                <td>Ghi Chú
                </td>
                <td>
                    @Html.TextAreaFor(model => model.GHI_CHU, new { @class = "input_table_function" })
                </td>
            </tr>
        </table>
        <div style="height: 20px"></div>
        <div class="footer_submit" style="margin-top: 0px; text-align: center">
            <button type="submit" onclick="return opBeginProcess_loading_window_submit(); ">
                <span class="l-btn-left l-btn-icon-left"><span class="l-btn-text">Cập nhật thuê bao</span><span class="l-btn-icon icon-add">&nbsp;</span></span>
            </button>
            <button type="button" onclick="return close_window_elements('window_addupdate_ontGPON');">
                <span class="l-btn-left l-btn-icon-left"><span class="l-btn-text">Hủy bỏ</span><span class="l-btn-icon icon-remove">&nbsp;</span></span></button>
        </div>
    </div>
    

}